<h1>My Tickets</h1>
<div class="content_wrp">
  <div class=" clear container">
    <div id="myticket_list" class=" mb22">
      <?php if ($pager->getNbResults()) : ?>
      <table>
        <thead>
          <tr>
            <th class="mname"><label>Movie</label></th>
            <th class="cinema"><label>Cinema</label></th>
            <th class="order"><label>Order date</label></th>
            <th class="quantity"><label>Quantity</label></th>
            <th class="tot"><label>Total price</label></th>
            <th class="prt"><label class="">Pridd</label></th>
          </tr>
        </thead>
        <tbody>
          
            <?php foreach ($pager->getResults() as $ticket) : ?>
              <?php $offer =  $ticket->getOFFER(); ?>
              <?php $movie =  $offer->getMOVIE(); ?>
              <?php $cinema =  $offer->getCINEMA(); ?>
              <tr>
                <td class="mname"><?php echo $movie->getTitle(); ?></td>
                <td class="cinema"><?php echo $cinema->getName(); ?></td>
                <td class="order"><?php echo date('d/m/y h:i A', strtotime($ticket->getPaymentDate())); ?></td>
                <td class="quantity"><?php echo $ticket->getQuantity(); ?></td>
                <td class="tot"><?php echo $ticket->getTotalPriceFormatted(); ?></td>
                <td class="pri"><a href="javascript:void(0);" name="<?php echo $ticket->getId(); ?>" alt="Print the receipt" title="Print the receipt" class="show_receipt">pri</a></td>
              </tr>
            <?php endforeach; ?>
          
        </tbody>
      </table>
        <?php include_partial('home/popup', array('isHidden' => 1)); ?>
      <?php else : ?>
      <div class="clear error_box radius">
        <p>You have not purchased any tickets yet.</p>
      </div>
      <div>
        <div class="frmbox_fl">
          <div class="clear">
            <input name="" type="button" value="&laquo; Visit Homepage" class="btn gray" onclick="document.location='<?php echo url_for('@home'); ?>'">
          </div>
        </div>
      </div>
      <?php endif; ?>
    </div>

    <!-- pagination -->
    <?php if(is_object($pager) && $pager->getNbResults() > sfConfig::get('app_list_records_per_page')):?>
    <div class="clear">
      <ul class="pagination right">
        <?php if ($pager->getPage() != $pager->getFirstPage()) : ?>
        <li class="first left"><a href="<?php echo url_for('@tickets?'.sfConfig::get('app_paginator_parameter_name').'='.$pager->getPreviousPage()); ?>"> &lt;&lt; </a></li>
        <?php endif; ?>
        <?php $links = $pager->getLinks(); ?>
        <?php foreach ($links as $page): ?>
          <li class="left">
            <a href="<?php echo url_for('@tickets?'.sfConfig::get('app_paginator_parameter_name').'='.$page); ?>"><?php echo $page; ?></a>
          </li>
        <?php endforeach; ?>
        <?php if ($pager->getPage() != $pager->getLastPage()) : ?>
        <li class="last left"><a href="<?php echo url_for('@tickets?'.sfConfig::get('app_paginator_parameter_name').'='.$pager->getNextPage()); ?>"> &gt;&gt; </a></li>
        <?php endif; ?>
      </ul>
    </div>
    <?php endif; ?>
    <!-- pagination -->

    </div>
  </div>